import * as constants from './constants';

const defaultState = {
	articleList:[],
	page:1,
	total:0,
	pageSize:20
};

export default ( state = defaultState, action) => {
	switch (action.type) {
		case constants.GET_HOME_LIST:
			return {...state, total:action.total, articleList:action.articleList, page:action.page,pageSize:action.pageSize};
		case constants.PAGE_HOME_LIST:
			return {...state, total:action.total, articleList:action.articleList, page:action.page,pageSize:action.pageSize};
		default :
			return state;
	}
};